package main;

import general.Kontakte;
import general.Tree;
import interfaces.Variablen;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import server.ChatServer;
import window.Fenster;
import window.SplitPanel;


/*
 * Created on 14.04.2011
 *
 * @author Benedikt
 *
 * createt first in Project Ch@t
 */

public class Main extends JFrame implements Variablen {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2590540686230062910L;

	private Kontakte kontakt;
	private Tree tree;
	private Fenster fenster;
	private SplitPanel splitPanel;
	public Main(String title) {

		super(title);
		setSize(mainWidth, mainHeight);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		tree = new Tree(fenster, splitPanel);
		kontakt = new Kontakte(tree);
		add(kontakt);

	}

	public static void main(String[] args) throws ClassNotFoundException,
			InstantiationException, IllegalAccessException {
		try {
			UIManager
					.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
		} catch (UnsupportedLookAndFeelException e) {
			e.printStackTrace();
		}
		new Main(title).setVisible(true);
		new ChatServer(2222);
	}
}
